package Control;

import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

import View.HomePage;
import View.MainFrame;
import View.MainPanel;
import View.SignInPage;
public class Main {
	
	 private MainPanel mainPanel;
	 private SignInPage signInPanel;
	 private HomePage homepagePanel;
	 private SignInPage signInPage;
	 MainFrame frame;
	
	 public static void main(String[] args) {
	        Main main = new Main();
	}
	
	public Main(){
		frame = new MainFrame();
        mainPanel = new MainPanel();
        frame.setPanel(mainPanel);
        
		signInPage = mainPanel.getSignInPage();
		mainPanel.add(signInPage);
		
		// hindi ako marunong mag-actionlistener sa different class, but this works...
		// please change if it is wrong... thankz~
		signInPage.signInListener(new ActionListener() {
 
            public void actionPerformed(ActionEvent e)
            {
                mainPanel.remove(signInPage);
                homepagePanel = mainPanel.getHomePage();
                mainPanel.add(homepagePanel);
                mainPanel.validate();
                mainPanel.repaint();
            }
        });      
	}

}
